package router

import (
	"github.com/gin-gonic/gin"
	"yk1/api/handle"
)

func Router(r *gin.Engine) {
	api := r.Group("/api")
	{
		administrators := api.Group("/administrators")
		{
			administrators.POST("add", handle.AdministratorsAdd)
		}
		rider := api.Group("/rider")
		{
			rider.POST("add", handle.RiderAdd)
			rider.POST("message", handle.Message)
		}
		cabinet := api.Group("/cabinet")
		{
			cabinet.POST("add", handle.CabinetAdd)
			cabinet.POST("details", handle.CabinetDetails)
			cabinet.POST("list", handle.CabinetList)
			cabinet.POST("modify", handle.ModifyCabinetState)
		}
		user := api.Group("/user")
		{
			user.POST("login", handle.Login)
			user.POST("details", handle.UserDetails)
			user.POST("list", handle.UserList)
		}
		delivery := api.Group("/delivery")
		{
			delivery.POST("add", handle.DeliveryAdd)
			delivery.POST("list", handle.DeliveryList)
			delivery.POST("details", handle.DeliveryDetails)
		}

	}

}
